//
//  ViewController.m
//  Calendar
//
//  Created by xuPeng on 2018/1/29.
//  Copyright © 2018年 xuPeng. All rights reserved.
//
#import "Header.h"
#import "MainViewController.h"
#import "MSSCalendarViewController.h"
#import "MSSCalendarDefine.h"

@interface MainViewController ()<MSSCalendarViewControllerDelegate>
@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addLeftUINavigationItem];

}

- (void)addLeftUINavigationItem{
    UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithTitle:@"日历" style:UIBarButtonItemStylePlain target:self action:@selector(clickLeftItem:)];
    self.navigationItem.rightBarButtonItem = buttonItem;
    
}

- (void)clickLeftItem:(UIBarButtonItem *)sender{
    MSSCalendarViewController *calendarVC = [[MSSCalendarViewController alloc] init];
    calendarVC.limitMonth = 12 * 5;// 显示几个月的日历
    /*
     MSSCalendarViewControllerLastType 只显示当前月之前
     MSSCalendarViewControllerMiddleType 前后各显示一半
     MSSCalendarViewControllerNextType 只显示当前月之后
     */
    calendarVC.type = MSSCalendarViewControllerMiddleType;
    
    calendarVC.beforeTodayCanTouch = NO;
    calendarVC.afterTodayCanTouch = YES;
    
//    calendarVC.startDate = 0;
//    calendarVC.endDate = [NSString stringWithFormat:@"2018-10-03"];
    calendarVC.showChineseHoliday = YES;
    calendarVC.showChineseCalendar = YES;
    calendarVC.showAlertView = YES;
    calendarVC.delegate = self;
    [self presentViewController:calendarVC animated:YES completion:nil];
    
}

@end
